<?php


class tx_zlib_registry
{

    /**
     * @var tx_zlib_registry
     */
    protected static $instance;

    /**
     * @var array
     */
    protected $values = array();

    /**
     * Singleton
     */
    protected function __construct()
    {}

    /**
     * Singleton
     */
    protected function __clone()
    {}

    /**
     * @return tx_zlib_registry
     */
    public static function instance()
    {
        if(self::$instance === null) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    /**
     * @param string $key
     * @param mixed $value
     */
    public function set($key, $value)
    {
        $this->values[$key] = $value;
    }

    /**
     * @param string $key
     * @return mixed
     */
    public function get($key) {
        if(isset($this->values[$key])) {
            return $this->values[$key];
        }
        return null;
    }

}


if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/zlib/class.tx_zlib_registry.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/zlib/class.tx_zlib_registry.php']);
}
